@extends('home.layout.index')
@section('content')

 <style>
    .abc{
    width:18px;
    height:20px;
    border:1px solid #1657A6;
    float:right;
    margin-top:0px;
    margin-right:2px;
    font-size:20px;
    size-color:pink;
    font-height:20px;
    display:block;
    }
    .meg{
    width:90px;
    height:20px;
    color:#1657A6;
    padding:3px;
    line-height:20px;
    font-size:12px;
    margin-top:9px;
    }
    #showanswer{
        width:92px;
        height:30px;
        border:1px solid #fff;
        color:green;
        background:pink;
        line-height:30px;
        text-align:center;
        margin-top:-7.3px;
        float:left;
        border-radius:4px;
    }
</style>

<div id="container">
    <div class="content">

        <div class="aside">

<!-- 登录 -->
<div class="aside-section">
        <div id="userBaseInfo">
            <div class="aside-login">
                <div class="aside-login-txt2">{{$count_que}}个</div>
                <div class="aside-login-txt">问题已被解决</div>
            </div>
        </div>

    </div>
<!-- 大家都在搜 -->
<div class="aside-section">
    <h2 class="home-tit">一周热搜</h2>
    <ul class="home-hot-lst">
        @foreach($category as $k=>$v)
        <li>
            <a href="/home/answer/create?qid={{$v['id']}}" target="_blank"><span class="home-hot-tag home-hot-clr">{{$v['cate_name']}}</span>
            <span class="home-hot-tit">{{$v['q_title']}}</span></a>
        </li>
        @endforeach
    </ul>
</div>
<!-- //大家都在搜 -->
<!-- //登录 -->
 <div id="aside_fix">
    <!-- 相关搜索 -->
    <div id="hint_search"></div>
    <!-- 精彩回答 -->
    <div id="topic_answer" style="min-height: 347px;"></div>
</div>
        </div>

        <div class="main">
            <div class="section">

            <div class="tags">


           </div>



    <script  src="/home/js/jquery-1.11.1.min.js"></script>
<h1 id="question_title" class="detail-tit-box">
    <span class="detail-tit" id="question_title_val">{{$data['q_title']}}</span>
        </h1>

    <!-- <textarea name="content" id="" cols="30" rows="10"></textarea> -->
    <pre id="question_content" class="detail-tit-info ">{!! $data['q_content'] !!}</pre>

<!-- ft-bar -->
<div class="ft-bar">
    <div class="ft-info-box">
        <div class="user-thumb-box">
            <a href="/home/userdetail/{{$data['uid']}}" target="_self" class="user-thumb getUserCard" data-uid="35356401"><img src="{{$q_user['photo']}}" width="100%" height="100%" alt="头像"></a>        </div>
        <div class="user-name-box">
            <a href="/home/userdetail/{{$data['uid']}}" target="_self" id="question_author" class="user-name">{{$q_user['nickname']}}</a>
        </div>
        <div class="user-txt">
            <span>{{$data['view']}}次浏览</span>
            <span>{{$data['count']}}次回答</span>
        </div>
    </div>
    <div class="ft-btn-box ">
        <a href="javascript:;" class="btn-reply toggle_answer  cur meg"> 收起回答 <i></i></a>
    </div>
</div>
<!-- //ft-bar -->
    <!-- edit-reply -->
    <div class="answer_box ipt-default ">
        <form action="/home/answer" method="post" id="myform">
        {{csrf_field()}}
        <div class="edit-reply answer_ing" id='meg' style="min-height: 196px;">
            <textarea name="a_content" id="text" cols="30" rows="10" style="width:100%;height:157px;"></textarea>
            <input type="hidden" name="qid" value="{{$data['id']}}">
            <input type="hidden" name="a_time" value="{{date('Y-m-d H:i:s')}}">
            <input type="hidden" name="uid" value="{{$data['uid']}}">
            <input type="hidden" name="path" value="0">
            <input type="hidden" name="pid" value="0">
            <div class="err-txtarea-prompt error_tips hide"></div>
        </div>
        <div class="ft-bar answer_btn">
            <div class="ft-btn-box">

                <input type="submit" id="submit_answer" class="btn-reply-submit" value="提交答案" style="color:black">

            </div>
                    <div class="btn-anonymous ">
                    <label for="set_anonymous" id="showanswer" value=""><a href="/home/answer/{{$data['id']}}" type="submit" >查看答案</a></label>
                    </div>
                       @if (count($errors) > 0)
                            <div class="err-txtarea-prompt error_tips hide">
                                <ul>
                                    @if(is_object($errors))
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    @else
                                        <li>{{ $errors }}</li>
                                    @endif
                                </ul>
                            </div>
                        @endif
        </div>
        </form>
    </div>
    <!-- //edit-reply -->

            </div>


            <!-- section -->
            <div class="section  hide ">



            </div>
            <!-- //section -->

            <!-- 底部相关 -->
            <div id="relates_box"></div>
            <div class="ad-activity-wrap " style="display:block;">
              <div class="abc" style="background-color:pink;">×</div>
                <a href="/" class="ad-activity-thumb">知之为知之，不知为不知，是智也！</a>
            </div>


        </div>
    </div>
    <script  src="/h/sougou/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
    $(function(){
    $('.meg').click(function(){
    $(".megclose").toggle("slow",function(){

        })
       });
   })
    $(document).ready(function(){
    $('.abc').click(function(){
    $('.ad-activity-wrap').css('display','none');
    })

    $(document).ready(function(){
    // var arr=getDocument.
    $('#myform').submit(function(){

        if(!session('login')){
            location.replace('/home');
        }
        var a_length = $('textarea').val().length;
        if(a_length==0){
            alert('不能提交空数据!!!');
            return false;
         }
         if(a_length<5){
            alert('问题回复太简单!!!');
             // $('textarea').val('问题回复太简单!!!');
            return false;
         }else{
            alert('回复成功');
         }

    })
}
    </script>
</div>

<a href="javascript:;" class="btn-gotop go_to_top hide"><i>置顶</i></a>
@endsection

